import CodeBlock from "@theme/CodeBlock";
import Example from "@examples/agents/connery_mrkl.ts";
import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx";

# Connery Toolkit

Using this toolkit, you can integrate Connery Actions into your LangChain agent.

:::note
If you want to use only one particular Connery Action in your agent,
check out the [Connery Action Tool](/docs/integrations/tools/connery) documentation.
:::

## What is Connery?

Connery is an open-source plugin infrastructure for AI.

With Connery, you can easily create a custom plugin with a set of actions and seamlessly integrate them into your LangChain agent.
Connery will take care of critical aspects such as runtime, authorization, secret management, access management, audit logs, and other vital features.

Furthermore, Connery, supported by our community, provides a diverse collection of ready-to-use open-source plugins for added convenience.

Learn more about Connery:

- GitHub: https://github.com/connery-io/connery
- Documentation: https://docs.connery.io

## Prerequisites

To use Connery Actions in your LangChain agent, you need to do some preparation:

1. Set up the Connery runner using the [Quickstart](https://docs.connery.io/docs/runner/quick-start/) guide.
2. Install all the plugins with the actions you want to use in your agent.
3. Set environment variables `CONNERY_RUNNER_URL` and `CONNERY_RUNNER_API_KEY` so the toolkit can communicate with the Connery Runner.

## Example of using Connery Toolkit

### Setup

To use the Connery Toolkit you need to install the following official peer dependency:

```bash npm2yarn
npm install @langchain/openai @langchain/community
```

<IntegrationInstallTooltip></IntegrationInstallTooltip>

### Usage

In the example below, we create an agent that uses two Connery Actions to summarize a public webpage and send the summary by email:

1. **Summarize public webpage** action from the [Summarization](https://github.com/connery-io/summarization-plugin) plugin.
2. **Send email** action from the [Gmail](https://github.com/connery-io/gmail) plugin.

:::info
You can see a LangSmith trace of this example [here](https://smith.langchain.com/public/5485cb37-b73d-458f-8162-43639f2b49e1/r).
:::

<CodeBlock language="typescript">{Example}</CodeBlock>

:::note
Connery Action is a structured tool, so you can only use it in the agents supporting structured tools.
:::
